<div style="min-width:870px;">
  <nz-breadcrumb class="breadcrumb-pos">
    <i nz-icon type="link" theme="outline" style="color:#1890FF;padding-right:4px"></i>
    <nz-breadcrumb-item>
      我的反馈
    </nz-breadcrumb-item>
  </nz-breadcrumb>
  <div nz-row [nzGutter]="8" style="border-bottom: 1px solid #ccc;margin-bottom: 8px;min-width: 800px;">
    <div nz-col [nzSpan]="4">
      <nz-form-item nzFlex>
        <nz-form-label>反馈类型</nz-form-label>
        <nz-select [(ngModel)]="type" style="margin-top:3px;">
          <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
          <nz-option [nzLabel]="'反馈'" [nzValue]="'2'"></nz-option>
          <nz-option [nzLabel]="'建议'" [nzValue]="'1'"></nz-option>
          <nz-option [nzLabel]="'投诉'" [nzValue]="'0'"></nz-option>
        </nz-select>
      </nz-form-item>
    </div>
    <div nz-col [nzSpan]="4">
      <nz-form-item nzFlex>
        <nz-form-label>反馈者</nz-form-label>
        <nz-select [(ngModel)]="userType" style="margin-top:3px;">
          <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
          <nz-option [nzLabel]="'维修员'" [nzValue]="'0'"></nz-option>
          <nz-option [nzLabel]="'租户'" [nzValue]="'1'"></nz-option>
        </nz-select>
      </nz-form-item>
    </div>
    <div nz-col [nzSpan]="5">
      <nz-form-item nzFlex>
        <nz-form-label>反馈内容</nz-form-label>
        <nz-form-control>
          <input nz-input [(ngModel)]="details">
        </nz-form-control>
      </nz-form-item>
    </div>
    <div nz-col [nzSpan]="5">
      <nz-form-item nzFlex>
        <nz-form-label>状态</nz-form-label>
        <nz-select [(ngModel)]="status" style="margin-top:3px;">
          <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
          <nz-option [nzLabel]="'未读'" [nzValue]="'0'"></nz-option>
          <nz-option [nzLabel]="'已读'" [nzValue]="'1'"></nz-option>
        </nz-select>
        <button nz-button [nzType]="'primary'" [nzLoading]="btn_loading" style="margin:3px 0 0 20px;" (click)="getFeedbacklist()">查询</button>
      </nz-form-item>
    </div>
  </div>

  <nz-table #basicTable [nzData]="feedbacklist" [nzLoading]="loading" [nzShowPagination]="false" [nzBordered]="true">
    <thead>
      <tr>
        <th>反馈类型</th>
        <th style="max-width:500px;">反馈内容</th>
        <th>反馈人</th>
        <th>反馈人类别</th>
        <th>联系方式</th>
        <th>反馈时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let data of feedbacklist">
        <td>{{data.typeStr}}</td>
        <td><div style="word-break:break-all;">{{data.details}}</div></td>
        <td>{{data.userType == 0 ? maintinfo[data.userId].name : userinfo[data.userId].name }}</td>
        <td>{{data.userType == 0?"维修员":"租户"}}</td>
        <td>{{data.contact}}</td>
        <td>{{data.dateAdd}}</td>
        <td>
          <a style="color:rgb(25, 190, 182);margin-right: 12px;" routerLink="/main/feedbackinfo/{{data.id}}">详情</a>
          <a [ngClass]="{'disable': data.status == 1}" (click)="read(data.id,data.status)">已读</a>
        </td>
      </tr>
    </tbody>
  </nz-table>

  <nz-modal [nzWidth]="600" [(nzVisible)]="isVisible" nzTitle="设置信息为 '已读'" (nzOnOk)="handleOk()" (nzOnCancel)="handleCancel()">
    <nz-form-item>
      <nz-form-label style="margin-top:-10px;" [nzSm]="6" [nzXs]="24" nzFor="remark">备注</nz-form-label>  
      <nz-form-control [nzSm]="14" [nzXs]="24">
          <textarea rows="4" nz-input [(ngModel)]="remark"></textarea>
      </nz-form-control>
    </nz-form-item>
  </nz-modal>

  <nz-pagination style="float:right;margin-top:12px" [nzPageIndex]="PageIndex" [nzPageSize]="PageSize"
    [nzTotal]="PageTotal" (nzPageIndexChange)="PageIndexChange($event)" [nzHideOnSinglePage]="true"
    [nzShowTotal]="totalTemplate"></nz-pagination>
  <ng-template #totalTemplate let-total>
    共 {{total}} 条数据
  </ng-template>
</div>